<template>
  <div v-if="companyInfoIndustry.company_id">
    <div v-if="companyInfoIndustry.patent_trend.data">
      <div class="title">专利申请情况及趋势</div>
      <div :style="{'fontSize': !PdfType ? '16px' : '20px'}" style="margin: 10px 0;line-height: initial;">
        <div>数据说明：</div>
        <div>1、以下表格数据以“当前权利人=当前公司名称”，按照专利的申请年度进行数据统计；由于专利公开时间存在滞后性，某年度的申请量仅代表当年的申请专利至今已公开的数量。</div>
        <div>2、核心发明人为本申请年度数量最多的发明人；</div>
        <div>3、本数据仅展示部分年份数据，不代表该公司的全部数据。</div>
      </div>
      <div class="table" v-if="!PdfType">
        <el-table :data="companyInfoIndustry.patent_trend.data" border style="width: 100%"
          :header-cell-style="{ background: '#f0f7fc' }">
          <el-table-column prop="0" :label="companyInfoIndustry.patent_trend.title[0].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[0])">
                <div v-for="item in scope.row[0]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[0] }}</div>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="5" width="65" :label="companyInfoIndustry.patent_trend.title[5].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[5])">
                <div v-for="item in scope.row[5]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[5] }}</div>
              </div>
            </template>
          </el-table-column>
          <el-table-column width="65" prop="6" :label="companyInfoIndustry.patent_trend.title[6].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[6])">
                <div v-for="item in scope.row[6]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[6] }}</div>
              </div>
            </template>
          </el-table-column>
          <el-table-column width="65" prop="7" :label="companyInfoIndustry.patent_trend.title[7].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[7])">
                <div v-for="item in scope.row[7]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[7] }}</div>
              </div>
            </template>
          </el-table-column>
          <el-table-column width="65" prop="8" :label="companyInfoIndustry.patent_trend.title[8].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[8])">
                <div v-for="item in scope.row[8]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[8] }}</div>
              </div>
            </template>
          </el-table-column>
          <el-table-column width="65" prop="9" :label="companyInfoIndustry.patent_trend.title[9].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[9])">
                <div v-for="item in scope.row[9]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[9] }}</div>
              </div>
            </template>
          </el-table-column>

          <el-table-column width="65" prop="10" :label="companyInfoIndustry.patent_trend.title[10].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[10])">
                <div v-for="item in scope.row[10]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[10] }}</div>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="11" :label="companyInfoIndustry.patent_trend.title[11].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[11])">
                <div v-for="item in scope.row[11]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[11] }}</div>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="12" :label="companyInfoIndustry.patent_trend.title[12].toString()">
            <template slot-scope="scope">
              <div v-if="Array.isArray(scope.row[12])">
                <div v-for="item in scope.row[12]">
                  {{ item }}
                </div>
              </div>
              <div v-else>
                <div>{{ scope.row[12] }}</div>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div v-else>
        <table border="1">
          <tr class="tableTr">
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[0].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[5].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[6].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[7].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[8].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[9].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[10].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[11].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_trend.title[12].toString() }}</th>
          </tr>
          <tr class="tableTr" v-for="(item, index) in companyInfoIndustry.patent_trend.data"
            :key="'companyInfoIndustry.patent_trend.data' + index">
            <td class="tableTd" align="center">{{ item[0] }}</td>
            <td class="tableTd" align="center">{{ item[5] }}</td>
            <td class="tableTd" align="center">{{ item[6] }}</td>
            <td class="tableTd" align="center">{{ item[7] }}</td>
            <td class="tableTd" align="center">{{ item[8] }}</td>
            <td class="tableTd" align="center">{{ item[9] }}</td>
            <td class="tableTd" align="center">{{ item[10] }}</td>
            <td class="tableTd" align="center">{{ item[11] }}</td>
            <td class="tableTd" align="center">{{ item[12] }}</td>
          </tr>
        </table>
      </div>
      <!-- *发明授权：当年所申请的专利至今的授权情况 -->
    </div>

    <div class="echarts" v-if="companyInfoIndustry.patent_line && !PdfType">
      <div class="left">
        <div @click="change(item.name)" v-for="item in companyInfoIndustry.patent_line"
          :class="item.name == lineType ? 'activation' : ''">
          {{ item.name }}
        </div>
      </div>
      <div class="right">
        <div class="echartsBox" ref="Line"></div>
      </div>
    </div>
    <div v-if="PdfType">
      <img width="600" height="210" style="object-fit: contain;text-align: center;margin: 0 auto;" :src="LineImg">
      <div class="legendText">专利总数图例</div>
    </div>



    <div v-if="companyInfoIndustry.patent_empower.data">
      <div class="title">发明专利授权率</div>
      <div :style="{'fontSize': !PdfType ? '16px' : '20px'}" style="margin-top: 10px;line-height: initial;">
        <div>数据说明：</div>
        <div>1、以下表格数据以“当前权利人=当前公司名称”，按照专利的申请年度进行数据统计；</div>
        <div>2、授权率=年度申请专利至今已授权的专利数量/年度申请专利的量；由于专利公开时间存在滞后性，某年度的申请量仅代表当年的申请专利至今已公开的数量。</div>
        <div>3、本数据仅展示部分年份数据，不代表该公司的全部数据。</div>
      </div>
      <div class="table table1" v-if="!PdfType">
        <el-table :data="companyInfoIndustry.patent_empower.data" border style="width: 100%"
          :header-cell-style="{ background: '#f0f7fc' }">
          <el-table-column prop="0" :label="companyInfoIndustry.patent_empower.title[0].toString()">
          </el-table-column>
          <el-table-column prop="5" :label="companyInfoIndustry.patent_empower.title[5].toString()">
          </el-table-column>
          <el-table-column prop="6" :label="companyInfoIndustry.patent_empower.title[6].toString()">
          </el-table-column>
          <el-table-column prop="7" :label="companyInfoIndustry.patent_empower.title[7].toString()">
          </el-table-column>
          <el-table-column prop="8" :label="companyInfoIndustry.patent_empower.title[8].toString()">
          </el-table-column>
          <el-table-column prop="9" :label="companyInfoIndustry.patent_empower.title[9].toString()">
          </el-table-column>
          <el-table-column prop="10" :label="companyInfoIndustry.patent_empower.title[10].toString()">
          </el-table-column>
        </el-table>
      </div>

      <div v-else>
        <table border="1">
          <tr class="tableTr">
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_empower.title[0].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_empower.title[5].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_empower.title[6].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_empower.title[7].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_empower.title[8].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_empower.title[9].toString() }}</th>
            <th class="tableTh" align="center">{{ companyInfoIndustry.patent_empower.title[10].toString() }}</th>
          </tr>
          <tr class="tableTr" v-for="(item, index) in companyInfoIndustry.patent_empower.data"
            :key="'companyInfoIndustry.patent_empower.data' + index">
            <td class="tableTd" align="center">{{ item[0] }}</td>
            <td class="tableTd" align="center">{{ item[5] }}</td>
            <td class="tableTd" align="center">{{ item[6] }}</td>
            <td class="tableTd" align="center">{{ item[7] }}</td>
            <td class="tableTd" align="center">{{ item[8] }}</td>
            <td class="tableTd" align="center">{{ item[9] }}</td>
            <td class="tableTd" align="center">{{ item[10] }}</td>
          </tr>
        </table>
      </div>

    </div>

    <div v-if="patent_transfer">
      <div class="title">
        专利受让情况：{{ companyInfoIndustry.patent_transfer.count }}
      </div>
      <div class="table" v-if="!PdfType">
        <el-table :data="patent_transfer" border style="width: 100%" :header-cell-style="{ background: '#f0f7fc' }"
          @row-click="rowClick">
          <el-table-column prop="aasc" label="受让人"> </el-table-column>
          <el-table-column prop="pasc" label="原权利人"> </el-table-column>
          <el-table-column prop="ano" label="专利号"> </el-table-column>
          <el-table-column prop="tio" label="专利名称"> </el-table-column>
          <el-table-column prop="inc" label="发明人"> </el-table-column>
        </el-table>
        <div class="more" @click="moreAdd(2)">查看全部</div>
      </div>
      <div v-else>
        <table border="1" v-if="patent_transfer.length">
          <tr class="tableTr">
            <th class="tableTh" align="center">受让人</th>
            <th class="tableTh" align="center">原权利人</th>
            <th class="tableTh" align="center">专利号</th>
            <th class="tableTh" align="center">专利名称</th>
            <th class="tableTh" align="center">发明人</th>
          </tr>
          <tr class="tableTr" v-for="(item, index) in patent_transfer" :key="'patent_transfer' + index">
            <td class="tableTd" align="center">{{ item.aasc }}</td>
            <td class="tableTd" align="center">{{ item.pasc }}</td>
            <td class="tableTd" align="center">{{ item.ano }}</td>
            <td class="tableTd" align="center">{{ item.tio }}</td>
            <td class="tableTd" align="center">{{ item.inc }}</td>
          </tr>
        </table>
        <div v-else class="legendText">暂无数据</div>

        <div v-if="patent_transfer.length > 10 && PdfType" style="margin-top: 5px;">
          **以上表格仅展示部分数据，更多信息请登录优专平台查看（zf.youpat.cn）</div>
      </div>
    </div>

    <div v-if="companyInfoIndustry.patent_insure">
      <div class="title">企业专利质押、许可、保险</div>
      <div class="table">
        <div class="PatentType" v-if="!preview">
          <div @click="insureType(item.name, index)" class="item" :class="item.name == patentType ? 'item2' : ''"
            v-for="(item, index) in companyInfoIndustry.patent_insure">
            <div class="value">{{ item.name }}</div>
            <div class="number">{{ item.value }}</div>
          </div>
        </div>
        <div v-if="!preview">
          <div>
            <el-table :data="patentInsureList.list" border style="width: 100%"
              :header-cell-style="{ background: '#f0f7fc' }" @row-click="rowClick">
              <el-table-column v-if="patentType != '专利转让'" prop="apo" label="申请人">
              </el-table-column>
              <el-table-column v-if="patentType != '专利转让'" prop="aspo" label="当前权利人">
              </el-table-column>
              <el-table-column v-if="patentType == '专利转让'" prop="pasc" header-align="center" label="转让前">
              </el-table-column>
              <el-table-column v-if="patentType == '专利转让'" prop="aasc" header-align="center" label="转让后">
              </el-table-column>
              <el-table-column prop="pno" label="专利号"> </el-table-column>
              <el-table-column prop="tio" label="专利名称"> </el-table-column>
              <el-table-column v-if="patentType != '专利转让'" prop="ino" label="发明人">
              </el-table-column>
            </el-table>
            <div class="more" @click="moreAdd(6)">查看全部</div>
          </div>

        </div>


        <div v-else>
          <div v-for="(item, index) in companyInfoIndustry.patent_insure">
            <div style="margin: 20px 0" class="title">
              {{ index + 1 }}、{{ item.name }}
            </div>

            <el-table v-if="!PdfType" :data="item.list.list" border style="width: 100%"
              :header-cell-style="{ background: '#f0f7fc' }" @row-click="rowClick">
              <el-table-column v-if="item.name != '专利转让'" prop="apo" label="申请人">
              </el-table-column>
              <el-table-column v-if="item.name != '专利转让'" prop="aspo" label="当前权利人">
              </el-table-column>
              <el-table-column v-if="item.name == '专利转让'" prop="pasc" header-align="center" label="转让前">
              </el-table-column>
              <el-table-column v-if="item.name == '专利转让'" prop="aasc" header-align="center" label="转让后">
              </el-table-column>
              <el-table-column prop="pno" label="专利号"> </el-table-column>
              <el-table-column prop="tio" label="专利名称"> </el-table-column>
              <el-table-column v-if="item.name != '专利转让'" prop="ino" label="发明人">
              </el-table-column>
              <el-table-column prop="inc" label="发明人"> </el-table-column>
            </el-table>

            <div v-else>
              <table border="1" v-if="item.list.list.length">
                <tr class="tableTr">
                  <th class="tableTh" v-if="patentType != '专利转让'" align="center">申请人</th>
                  <th class="tableTh" v-if="patentType != '专利转让'" align="center">当前权利人</th>
                  <th class="tableTh" v-if="patentType == '专利转让'" align="center">转让前</th>
                  <th class="tableTh" v-if="patentType == '专利转让'" align="center">转让后</th>
                  <th class="tableTh" align="center">专利号</th>
                  <th class="tableTh" align="center">专利名称</th>
                  <th class="tableTh" v-if="patentType != '专利转让'" align="center">发明人</th>
                </tr>
                <tr class="tableTr" v-for="(item_, index) in item.list.list" :key="'patentInsureList.list' + index">
                  <td class="tableTd" v-if="patentType != '专利转让'" align="center">{{ item_.apo }}</td>
                  <td class="tableTd" v-if="patentType != '专利转让'" align="center">{{ item_.aspo }}</td>
                  <td class="tableTd" v-if="patentType == '专利转让'" align="center">{{ item_.pasc }}</td>
                  <td class="tableTd" v-if="patentType == '专利转让'" align="center">{{ item_.aasc }}</td>
                  <td class="tableTd" align="center">{{ item_.pno }}</td>
                  <td class="tableTd" align="center">{{ item_.tio }}</td>
                  <td class="tableTd" v-if="patentType != '专利转让'" align="center">{{ item_.ino }}</td>
                </tr>
              </table>

              <div v-else class="legendText">暂无数据</div>


            </div>
          </div>
        </div>
      </div>
    </div>

    <div v-if="companyInfoIndustry.patent_agency">
      <div class="title">
        知识产权代理服务机构：{{ companyInfoIndustry.patent_agency.cro_num }}家
      </div>

      <div class="table" v-if="!PdfType">
        <el-table :data="patent_agency.slice(0, 10)" border style="width: 100%"
          :header-cell-style="{ background: '#f0f7fc' }">
          <el-table-column prop="value" label="机构"> </el-table-column>
          <el-table-column prop="count" width="100" label="数量"> </el-table-column>
        </el-table>
        <div class="more" @click="moreAdd(7)">查看全部</div>
      </div>

      <div v-else>
        <table border="1" v-if="patent_agency.length">
          <tr class="tableTr">
            <th class="tableTh" align="center">机构</th>
            <th class="tableTh" align="center">数量</th>
          </tr>
          <tr class="tableTr" v-for="(item, index) in patent_agency.slice(0, 10)" :key="'patent_agency' + index">
            <td class="tableTd" align="center">{{ item.value }}</td>
            <td class="tableTd" align="center">{{ item.count }}</td>
          </tr>
        </table>
        <div v-else class="legendText">暂无数据</div>

        <div v-if="patent_agency.length > 10 && PdfType" style="margin-top: 5px;">
          **以上表格仅展示部分数据，更多信息请登录优专平台查看（zf.youpat.cn）</div>
      </div>

      <div class="newinstitutionName" v-if="companyInfoIndustry.patent_agency.cro_list.length">
        <div class="title_small">企业最新公开或授权的10件专利申请的代理机构为:</div>
        <div v-for="item in companyInfoIndustry.patent_agency.cro_list">
          {{ item.name }}，注册地址：{{ item.address
          }}<span class="span1" v-if="!item.is_true">非辖区内机构</span>
          <span class="span2" v-else>辖区内机构</span>
        </div>
      </div>
    </div>

    <div v-if="companyInfoIndustry.patent_agency_rate">
      <div v-if="!PdfType" class="institutionName title_small">上述机构代理情况:</div>
      <div v-else class="title_small">上述机构代理情况:</div>

      <div class="table">
        <el-table v-if="!preview" :data="companyInfoIndustry.patent_agency_rate" border style="width: 100%"
          :header-cell-style="{ background: '#f0f7fc' }">
          <el-table-column prop="0" label="代理机构"> </el-table-column>
          <el-table-column prop="34" label="总授权率"> </el-table-column>

          <el-table-column header-align="center" :label="companyInfoIndustry.year[6].toString()">
            <el-table-column header-align="center" prop="19" label="发明">
            </el-table-column>
            <el-table-column header-align="center" prop="20" label="实用新型">
            </el-table-column>
            <el-table-column header-align="center" prop="21" label="外观设计">
            </el-table-column>
          </el-table-column>

          <el-table-column header-align="center" :label="companyInfoIndustry.year[7].toString()">
            <el-table-column header-align="center" prop="22" label="发明">
            </el-table-column>
            <el-table-column header-align="center" prop="23" label="实用新型">
            </el-table-column>
            <el-table-column header-align="center" prop="24" label="外观设计">
            </el-table-column>
          </el-table-column>

          <el-table-column header-align="center" :label="companyInfoIndustry.year[8].toString()">
            <el-table-column header-align="center" prop="25" label="发明">
            </el-table-column>
            <el-table-column header-align="center" prop="26" label="实用新型">
            </el-table-column>
            <el-table-column header-align="center" prop="27" label="外观设计">
            </el-table-column>
          </el-table-column>

          <el-table-column header-align="center" prop="32" label="撤回">
          </el-table-column>
          <el-table-column header-align="center" prop="33" label="驳回">
          </el-table-column>
        </el-table>

        <div v-else class="towTable">
          <el-table v-if="!PdfType" :data="companyInfoIndustry.patent_agency_rate_two" border style="width: 100%"
            :header-cell-style="{ background: '#f0f7fc', display: 'none' }">
            <el-table-column v-for="(item, index) in companyInfoIndustry.patent_agency_rate_two[0]"
              :prop="index.toString()" label="">
            </el-table-column>
          </el-table>

          <div v-else>
            <table border="1" v-if="companyInfoIndustry.patent_agency_rate_two.length">
              <tr class="tableTr">
                <th v-for="(item, index) in companyInfoIndustry.patent_agency_rate_two[0]" class="tableTh" align="center">
                  {{ item }}
                </th>
              </tr>
              <tr class="tableTr" v-for="(item, index) in companyInfoIndustry.patent_agency_rate_two.slice(1)"
                :key="'companyInfoIndustry.patent_agency_rate_two' + index">
                <td class="tableTd" align="center" v-for="(item_, index_) in item"
                  :key="'companyInfoIndustry.patent_agency_rate_two[0]' + index_">{{ item_ }}</td>
              </tr>
            </table>
            <div v-else class="legendText">暂无数据</div>

          </div>
        </div>
      </div>



    </div>
  </div>
</template>

<script>
import * as echarts from "echarts";
import { } from "@/api/newuser";
export default {
  data() {
    return {
      lineType: "",
      patentType: "",
      patentInsureList: [],
      patent_transfer: null,
      patent_transferType: true,

      patent_agency: [],
      patent_agencyType: true,
      LineImg: ''
    };
  },
  watch: {
    companyInfoIndustry: {
      handler(newVal, oldVal) {
        this.upData();
      },
      deep: true,
    },
    PdfType: {
      handler(newVal, oldVal) {
        this.$nextTick(() => {
          this.change('专利总数');
        });
      }
    }
  },
  filters: {},
  props: {
    PdfType: {
      type: Boolean,
      default: false,
    },
    companyInfoIndustry: {
      type: Object,
      default: () => { },
    },
    preview: {
      type: Boolean,
      default: false,
    },
  },
  components: {},
  mounted() {
    if (this.companyInfoIndustry.company_id) {
      this.upData();
    }
  },
  methods: {
    rowClick(row, column, event) {
      console.log(row, column, event, "row, column, event");

      //新窗口打开
      const { href } = this.$router.resolve({
        path: "/detail",
      });
      window.open(href + `?pid=${row.pid}&preview=1`, "_blank");
    },
    moreAdd(type) {
      let routerJump;
      if (type == 2) {
        routerJump = this.$router.resolve({
          path: "/morePatents",
          query: {
            patentType: type,
            companyName: this.companyInfoIndustry.company,
            company_id: this.companyInfoIndustry.company_id,
          },
        });
      } else if (type == 6) {
        routerJump = this.$router.resolve({
          path: "/morePatents",
          query: {
            patentType: type,
            company_id: this.companyInfoIndustry.company_id,
            name: this.patentType,
            companyName: this.companyInfoIndustry.company,
          },
        });
      } else if (type == 7) {
        routerJump = this.$router.resolve({
          path: "/morePatents",
          query: {
            patentType: type,
            companyName: this.companyInfoIndustry.company,
            company_id: this.companyInfoIndustry.company_id,
          },
        });
      } else if (type == 10) {
        routerJump = this.$router.resolve({
          path: "/morePatents",
          query: {
            patentType: type,
            company_id: this.companyInfoIndustry.company_id,
            name: 'PCT',
            companyName: this.companyInfoIndustry.company,
          },
        });
      }

      window.open(routerJump.href, "_blank");
    },
    upData() {
      this.lineType = this.companyInfoIndustry.patent_line
        ? this.companyInfoIndustry.patent_line[0].name
        : "";
      this.patentType = this.companyInfoIndustry.patent_insure
        ? this.companyInfoIndustry.patent_insure[0].name
        : "";
      this.patentInsureList = this.companyInfoIndustry.patent_insure
        ? this.companyInfoIndustry.patent_insure[0].list
        : "";
      this.patent_transfer = this.companyInfoIndustry.patent_transfer
        ? this.companyInfoIndustry.patent_transfer.list
        : null;
      this.patent_agency = this.companyInfoIndustry.patent_agency
        ? this.companyInfoIndustry.patent_agency.cro
        : "";
      this.$nextTick(() => {
        this.companyInfoIndustry.patent_line ? this.line() : "";
      });
    },
    insureType(name, index) {
      this.patentType = name;
      this.patentInsureList = this.companyInfoIndustry.patent_insure[index].list;
    },
    change(name) {
      this.lineType = name;
      var chartDom = this.$refs.Line;
      if (chartDom == null) {
        return;
      }
      echarts.dispose(chartDom);
      this.line();
    },
    line() {
      var chartDom = this.$refs.Line;

      let data = [];
      this.companyInfoIndustry.patent_line.map((res) => {
        if (res.name == this.lineType) {
          data = res.value;
        }
      });

      let x_data = [...this.companyInfoIndustry.patent_empower.title]
      x_data.shift()


      var myChart = echarts.init(chartDom);
      var option = {
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "shadow",
            label: {
              show: true,
            },
          },
        },
        grid: {
          top: "20px",
          left: "10px",
          right: "30px",
          bottom: "0px",
          containLabel: true,
        },
        xAxis: {
          type: "category",
          data: x_data,
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: data,
            type: "line",
          },
        ],
      };

      option && myChart.setOption(option);

      setTimeout(() => {
        // 获取echart图片
        this.LineImg = myChart.getDataURL({
          pixelRatio: 2,
          width: 600,
          height: 300,
        });
      }, 1000);
    },
  },
};
</script>

<style scoped lang="less">
::v-deep .table1 {
  .el-table--border {
    .el-table__body-wrapper {
      .el-table__body {
        tbody {
          tr:nth-child(6) {
            background-color: #f0f7fc;
          }
        }
      }
    }
  }
}

.more {
  text-align: center;
  padding: 20px;
  border-bottom: 1px solid #ebeef5;
  cursor: pointer;
}

.title {
  font-size: 18px;
  font-weight: bold;
}

.table {
  padding: 20px 0px;
}

.institutionName {
  margin: 30px 0 20px 0;
  font-size: 14px;
}

.title_small {
  font-size: 16px;
  font-weight: bold;
}

.newinstitutionName {
  margin: 40px 0;
  font-size: 14px;

  div {
    margin-bottom: 10px;
    line-height: 20px;

    .span1 {
      background-color: #ff5f59;
      border-radius: 2px;
      color: #fff;
      font-size: 11px;
      padding: 0px 3px;
      margin-left: 5px;
      box-sizing: border-box;
      display: inline-block;
    }

    .span2 {
      background-color: #2e9a3c;
      border-radius: 2px;
      color: #fff;
      font-size: 11px;
      padding: 0px 3px;
      margin-left: 5px;
      box-sizing: border-box;
      display: inline-block;
    }
  }
}

.PatentType {
  display: flex;

  .item {
    background-color: #f2f3f5;
    border-radius: 10px;
    border: 1px solid #3677f5;
    padding: 20px 0;
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    margin-right: 30px;
    cursor: pointer;

    .value {
      color: #3677f5;
      font-size: 16px;
      margin-bottom: 4px;
    }

    .number {
      font-size: 30px;
    }
  }

  .item2 {
    background-color: #3677f5;

    .value {
      color: #fff;
    }

    .number {
      color: #fff;
    }
  }
}

.tableBgc {
  background: #f0f7fc;
}

.echartsBox {
  width: 100%;
  height: 100%;
}

.echarts {
  padding: 20px 0px;
  display: flex;

  .left {
    width: 100px;

    .activation {
      color: #006cff;
    }

    div {
      margin-bottom: 10px;
      cursor: pointer;
    }
  }

  .right {
    flex: 1;
  }
}

@media (max-width: 1360px) {}

@media (max-width: 1280px) {}

@media (max-width: 768px) {}
</style>
